package com.gof.example.visitor;

/**
 * Created with IntelliJ IDEA.
 * Created by zhiyuan on 2018/5/11 17:53.
 * haiming.fei@tongdun.cn
 */
public class WelldoneAwardCheck extends AwardCheck {

    @Override
    void visit(Teacher teacher) {
        int score = teacher.getScore();
        if (score >= 90) {
            System.out.println(teacher + ", achieve welldoneAwards");
        } else {
            System.out.println(teacher + ", achieve no welldoneAwards");
        }
    }

    @Override
    void visit(Student student) {
        int score = student.getScore();
        if (score >= 90) {
            System.out.println(student + ", achieve welldoneAwards");
        } else {
            System.out.println(student + ", achieve no welldoneAwards");
        }
    }
}
